import http from "./interceptors";
import Qs from 'qs'; //如果不需要请注释
export function getRequest (url?:any, data = {}) {
  return new Promise((resolve, reject) => {
    http.get(url, {
        params: data
      }).then(response => {
        resolve(response);
      }).catch(err => {
        reject(err);
      });
  });
};
export function postRequest (url:any, data = {}) {
  return new Promise((resolve, reject) => {
    http.post(url, data).then(response => {
        resolve(response);
      })
      .catch(err => {
        reject(err);
      });
  });
};
